﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:props="clr-namespace:ScrumFactory.Windows.Properties;assembly=ScrumFactory.Windows"
                    xmlns:local="clr-namespace:ScrumFactory.Windows"
                    xmlns:SF_Helpers="clr-namespace:ScrumFactory.Windows.Helpers;assembly=ScrumFactory.Windows.Helpers"
                    xmlns:SF_Converters="clr-namespace:ScrumFactory.Windows.Helpers.Converters;assembly=ScrumFactory.Windows.Helpers">

    <SF_Converters:ToLowerConverter x:Key="ToLowerConverter" />

    

    
    <Style  TargetType="{x:Type SF_Helpers:PanelLayout}">
        <Setter Property="Background" Value="White"/>
        <Setter Property="BorderBrush" Value="#EAEAEA" />
        <Setter Property="Foreground" Value="{StaticResource TextBrush}"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type SF_Helpers:PanelLayout}">
                    <Grid Margin="0,0,0,0">                       
                        <Grid.RowDefinitions>                            
                            <RowDefinition Height="Auto" MinHeight="80" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>

                        <TextBlock 
                            Grid.Row="0" Grid.RowSpan="4" Text="{TemplateBinding Title, Converter={StaticResource ToLowerConverter}}" Style="{StaticResource PanelMainTitle}"
                          
                            VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,-30,0,0" Padding="0"  />

                        <ContentPresenter Grid.Row="0" Content="{TemplateBinding Toolbar}" Margin="5,0,0,0" />


                        <!--<Border Grid.Row="1" HorizontalAlignment="Stretch"  x:Name="windowTitle" 
                                Padding="25,3,5,3"
                                BorderThickness="0,1,0,1" BorderBrush="{TemplateBinding BorderBrush}" Background="#FAFAFA">
                            <Grid>
                                
                                <StackPanel Orientation="Horizontal">

                                    <TextBox FontWeight="SemiBold" Margin="0" Padding="0" Foreground="{StaticResource ItemGroupBrush}" Style="{StaticResource CleanTextBox}" IsReadOnly="True">
                                        <TextBox.Text>
                                            <MultiBinding StringFormat="{}{0} - {1} [{2}]">
                                                <Binding Mode="OneTime" Path="Project.ClientName"/>
                                                <Binding Mode="OneTime" Path="Project.ProjectName"/>
                                                <Binding Mode="OneTime" Path="Project.ProjectNumber"/>
                                            </MultiBinding>
                                        </TextBox.Text>
                                    </TextBox>

                                    <Button 
                                        Style="{StaticResource OverButton}"
                                        Command="{Binding DataContext.CopyProjectUrlCommand, RelativeSource={RelativeSource AncestorType={x:Type SF_Helpers:DockWindowContainer}}}"                                         
                                        VerticalAlignment="Stretch" ToolTip="{x:Static props:Resources.Copy_project_url_to_clipboard}">
                                        <Image Source="/Images/Toolbar/tag.png" Width="16" Height="16" Margin="5,0,5,0" VerticalAlignment="Center"/>
                                    </Button>


                                    <Button 
                                        Command="{Binding DataContext.ShowDocRepositoryCommand, RelativeSource={RelativeSource AncestorType={x:Type SF_Helpers:DockWindowContainer}}}"                                         
                                        VerticalAlignment="Stretch" ToolTip="{Binding Project.DocRepositoryPath}" Margin="0">
                                        <Image Source="/Images/Buttons/DocRep.png" Width="16" Height="16" Margin="5,0,5,0" VerticalAlignment="Center"/>
                                        <Button.Style>
                                            <Style BasedOn="{StaticResource OverButton}" TargetType="Button">
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding Project.DocRepositoryPath}" Value="{x:Null}">
                                                        <Setter Property="Visibility" Value="Collapsed"/>
                                                    </DataTrigger>
                                                    <DataTrigger Binding="{Binding Project.DocRepositoryPath}" Value="">
                                                        <Setter Property="Visibility" Value="Collapsed"/>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Button.Style>
                                    </Button>


                                    <Button 
                                        Command="{Binding DataContext.ShowCodeRepositoryCommand, RelativeSource={RelativeSource AncestorType={x:Type SF_Helpers:DockWindowContainer}}}"                                         
                                        VerticalAlignment="Stretch" ToolTip="{Binding Project.CodeRepositoryPath}">
                                        <Image Source="/Images/Buttons/CodeRep.png" Width="16" Height="16" Margin="5,0,5,0" VerticalAlignment="Center"/>
                                        <Button.Style>
                                            <Style BasedOn="{StaticResource OverButton}" TargetType="Button">
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding Project.CodeRepositoryPath}" Value="{x:Null}">
                                                        <Setter Property="Visibility" Value="Collapsed"/>
                                                    </DataTrigger>
                                                    <DataTrigger Binding="{Binding Project.CodeRepositoryPath}" Value="">
                                                        <Setter Property="Visibility" Value="Collapsed"/>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Button.Style>
                                    </Button>

                                  
                                </StackPanel>
                                
                                
                                
                                
                                <local:SprintIndicator DataContext="{Binding Project}" HorizontalAlignment="Right" />
                            </Grid>
                            
                        </Border>-->

                        

                        <Border Grid.Row="2" Background="{TemplateBinding Background}">
                            <ContentPresenter Content="{TemplateBinding SubContent}" Margin="0"  />                            
                        </Border>

                        <Border Grid.Row="3" Background="{TemplateBinding Background}">
                            <ContentPresenter Content="{TemplateBinding Content}" Margin="25,10,5,0"  />
                        </Border>


                        





                    </Grid>
                    <!--<ControlTemplate.Triggers>
                        <Trigger Property="ShowCurrentProjectName" Value="False">
                            <Setter TargetName="windowTitle" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                    </ControlTemplate.Triggers>-->
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="CoverPanelLayout" TargetType="{x:Type SF_Helpers:PanelLayout}" BasedOn="{StaticResource {x:Type SF_Helpers:PanelLayout}}">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="ShowCurrentProjectName" Value="False"/>
        

    </Style>

    <Style x:Key="DetailPanelLayout" TargetType="{x:Type SF_Helpers:PanelLayout}" BasedOn="{StaticResource {x:Type SF_Helpers:PanelLayout}}">
        <!--<Setter Property="Background" Value="White"/>
        <Setter Property="Foreground" Value="{StaticResource TextBrush}"/>
        <Setter Property="BorderBrush" Value="#EAEAEA" />        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type SF_Helpers:PanelLayout}">
                    <Grid Margin="0,0,0,0">
                        <Grid.InputBindings>
                            <KeyBinding Key="Esc" Command="{Binding CloseWindowCommand}" />
                        </Grid.InputBindings>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" MinHeight="80" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>

                        <TextBlock 
                            Grid.Row="0" Grid.RowSpan="2" Text="{TemplateBinding Title, Converter={StaticResource ToLowerConverter}}" Style="{StaticResource PanelMainTitle}"
                            VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,-30,0,0" Padding="0" />


                        <ContentPresenter Grid.Row="0" Content="{TemplateBinding Toolbar}" Margin="5,0,0,0" />


                        --><!--<TextBlock x:Name="windowTitle" Grid.Row="0" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="3"
                                   Style="{StaticResource PanelSubTitle}"
                                   Text="{Binding Model.WindowTitle, RelativeSource={RelativeSource AncestorType={x:Type Window}}}"/>-->

                        <!--<TextBlock x:Name="windowTitle" Grid.Row="0" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="3"
                                   Style="{StaticResource PanelSubTitle}">
                            <Run Text="{Binding Project.ClientName}"/>
                            <Run Text="{Binding Project.ProjectName, StringFormat='{} - {0}'}"/>
                            <Run Text="{Binding Project.ProjectNumber, StringFormat='{} [{0}]'}"/>
                        </TextBlock>--><!--

                        <Border Grid.Row="1" HorizontalAlignment="Stretch"  x:Name="windowTitle" 
                                Padding="26,3,5,3"
                                BorderThickness="0,1,0,1" BorderBrush="{TemplateBinding BorderBrush}" Background="#FAFAFA">
                            <Grid>

                                <StackPanel Orientation="Horizontal">

                                    <Button 
                                        Style="{StaticResource OverButton}"
                                        Command="{Binding DataContext.CopyProjectUrlCommand, RelativeSource={RelativeSource AncestorType={x:Type SF_Helpers:DockWindowContainer}}}"                                         
                                        VerticalAlignment="Stretch" ToolTip="{x:Static props:Resources.Copy_project_url_to_clipboard}">
                                        <Image Source="/Images/Toolbar/tag.png" Width="16" Height="16" Margin="5,0,5,0" VerticalAlignment="Center"/>
                                    </Button>

                                    <TextBlock FontSize="{StaticResource SmallFontSize}" Foreground="{StaticResource ItemGroupBrush}" FontWeight="SemiBold" Margin="2" Padding="0">
                                        <Run Text="{Binding Project.ClientName}"/>
                                        <Run Text="{Binding Project.ProjectName, StringFormat='{} - {0}'}"/>
                                        <Run Text="{Binding Project.ProjectNumber, StringFormat='{} [{0}]'}"/>
                                    </TextBlock>

                                    <Button 
                                        Command="{Binding DataContext.ShowDocRepositoryCommand, RelativeSource={RelativeSource AncestorType={x:Type SF_Helpers:DockWindowContainer}}}"                                         
                                        VerticalAlignment="Stretch" ToolTip="{Binding Project.DocRepositoryPath}" Margin="0">
                                        <Image Source="/Images/Buttons/DocRep.png" Width="16" Height="16" Margin="5,0,5,0" VerticalAlignment="Center"/>
                                        <Button.Style>
                                            <Style BasedOn="{StaticResource OverButton}" TargetType="Button">
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding Project.DocRepositoryPath}" Value="{x:Null}">
                                                        <Setter Property="Visibility" Value="Collapsed"/>
                                                    </DataTrigger>
                                                    <DataTrigger Binding="{Binding Project.DocRepositoryPath}" Value="">
                                                        <Setter Property="Visibility" Value="Collapsed"/>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Button.Style>
                                    </Button>


                                    <Button 
                                        Command="{Binding DataContext.ShowCodeRepositoryCommand, RelativeSource={RelativeSource AncestorType={x:Type SF_Helpers:DockWindowContainer}}}"                                         
                                        VerticalAlignment="Stretch" ToolTip="{Binding Project.CodeRepositoryPath}">
                                        <Image Source="/Images/Buttons/CodeRep.png" Width="16" Height="16" Margin="5,0,5,0" VerticalAlignment="Center"/>
                                        <Button.Style>
                                            <Style BasedOn="{StaticResource OverButton}" TargetType="Button">
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding Project.CodeRepositoryPath}" Value="{x:Null}">
                                                        <Setter Property="Visibility" Value="Collapsed"/>
                                                    </DataTrigger>
                                                    <DataTrigger Binding="{Binding Project.CodeRepositoryPath}" Value="">
                                                        <Setter Property="Visibility" Value="Collapsed"/>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Button.Style>
                                    </Button>


                                </StackPanel>




                                <local:SprintIndicator DataContext="{Binding Project}" HorizontalAlignment="Right" />
                            </Grid>

                        </Border>


                        <Border 
                            Grid.Row="2" 
                            BorderThickness="0,0,0,0" 
                            BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" 
                            Padding="25,0,5,0">
                            <ContentPresenter Content="{TemplateBinding Content}" Margin="0,5,0,0" />
                        </Border>



                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="ShowCurrentProjectName" Value="False">
                            <Setter TargetName="windowTitle" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
                
            </Setter.Value>
        </Setter>-->
    </Style>


</ResourceDictionary>